package com.manlost.biz.tag.model.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * 类TagRelationType.java的实现描述：TODO 类实现描述
 * 
 * @author xiaochuan.luxc 2012-4-9 下午9:53:46
 */
public enum TagType {
    ACCOUNT("account"), SYSTEM("system");

    private final String               value;

    private static Map<String, String> tagTypeMap;

    static {
        tagTypeMap = new HashMap<String, String>();
        for (TagType type : values()) {
            tagTypeMap.put(type.name(), type.getValue());
        }
    }

    public String getValue() {
        return value;
    }

    private TagType(String value) {
        this.value = value;
    }

    public static TagType getEnum(String value) {
        for (TagType type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

    public static Map<String, String> getTagTypeMap() {
        return tagTypeMap;
    }
}
